from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):

    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.setEnabled(True)
        MainWindow.resize(784, 542)
        MainWindow.setMinimumSize(QtCore.QSize(200, 150))
        # 更改主窗口背景颜色为更柔和的蓝色
        MainWindow.setStyleSheet("background-color: #2c3e50;")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.centralwidget)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.widget = QtWidgets.QWidget(self.centralwidget)
        # 更改内部容器背景颜色为稍浅的蓝色
        self.widget.setStyleSheet("background-color: #34495e; border-radius: 10px;")
        self.widget.setObjectName("widget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(self.widget)
        # 更改标题标签背景颜色和字体样式，调整字体大小为22px
        self.label.setStyleSheet(
                "background-color: #3498db; color: white; font-size: 22px; font-weight: bold; border-radius: 5px; padding: 10px;"
                )
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.label_2 = QtWidgets.QLabel(self.widget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setStyleSheet("background-image: url(:/tu/liupansha.jpg); border-radius: 10px;")
        self.label_2.setText("")
        self.label_2.setPixmap(QtGui.QPixmap(":/tu/liupansha.jpg"))
        self.label_2.setScaledContents(True)
        self.label_2.setObjectName("label_2")
        self.verticalLayout.addWidget(self.label_2)
        self.widget_2 = QtWidgets.QWidget(self.widget)
        # 更改按钮容器背景颜色
        self.widget_2.setStyleSheet("background-color: #3498db; border-radius: 5px;")
        self.widget_2.setObjectName("widget_2")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget_2)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pushButton = QtWidgets.QPushButton(self.widget_2)
        # 为按钮添加样式，包括圆角、阴影和悬停效果，调整字体大小为16px
        self.pushButton.setStyleSheet(
                """
                QPushButton {
                    background-color: #2980b9;
                    color: white;
                    font-size: 16px;
                    padding: 10px 20px;
                    border-radius: 5px;
                    border: none;
                    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
                }
                QPushButton:hover {
                    background-color: #3498db;
                }
                """
                )
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout.addWidget(self.pushButton)
        self.pushButton_2 = QtWidgets.QPushButton(self.widget_2)
        # 调整字体大小为16px
        self.pushButton_2.setStyleSheet(
                """
                QPushButton {
                    background-color: #2980b9;
                    color: white;
                    font-size: 16px;
                    padding: 10px 20px;
                    border-radius: 5px;
                    border: none;
                    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
                }
                QPushButton:hover {
                    background-color: #3498db;
                }
                """
                )
        self.pushButton_2.setObjectName("pushButton_2")
        self.horizontalLayout.addWidget(self.pushButton_2)
        self.pushButton_3 = QtWidgets.QPushButton(self.widget_2)
        # 调整字体大小为16px
        self.pushButton_3.setStyleSheet(
                """
                QPushButton {
                    background-color: #2980b9;
                    color: white;
                    font-size: 16px;
                    padding: 10px 20px;
                    border-radius: 5px;
                    border: none;
                    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
                }
                QPushButton:hover {
                    background-color: #3498db;
                }
                """
                )
        self.pushButton_3.setObjectName("pushButton_3")
        self.horizontalLayout.addWidget(self.pushButton_3)
        self.pushButton_4 = QtWidgets.QPushButton(self.widget_2)
        # 调整字体大小为16px
        self.pushButton_4.setStyleSheet(
                """
                QPushButton {
                    background-color: #e74c3c;
                    color: white;
                    font-size: 16px;
                    padding: 10px 20px;
                    border-radius: 5px;
                    border: none;
                    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
                }
                QPushButton:hover {
                    background-color: #c0392b;
                }
                """
                )
        self.pushButton_4.setObjectName("pushButton_4")
        self.horizontalLayout.addWidget(self.pushButton_4)
        self.verticalLayout.addWidget(self.widget_2)
        self.verticalLayout.setStretch(1, 4)
        self.verticalLayout_2.addWidget(self.widget)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 784, 22))
        self.menubar.setObjectName("menubar")
        self.menu = QtWidgets.QMenu(self.menubar)
        # 更改菜单栏样式，调整字体大小为14px
        self.menu.setStyleSheet(
                """
                QMenu {
                    background-color: #34495e;
                    color: white;
                    font-size: 14px;
                }
                QMenu::item {
                    padding: 5px 20px;
                }
                QMenu::item:selected {
                    background-color: #3498db;
                }
                """
                )
        self.menu.setObjectName("menu")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        # 更改状态栏样式，调整字体大小为14px
        self.statusbar.setStyleSheet("background-color: #34495e; color: white; font-size: 14px;")
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.menubar.addAction(self.menu.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)

    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
        self.label.setText(
                _translate(
                        "MainWindow", "<html><head/><body><p align=\"center\">无人机视角地面物体检测</p></body></html>"
                        )
                )
        self.pushButton.setText(_translate("MainWindow", "图片识别"))
        self.pushButton_2.setText(_translate("MainWindow", "视频识别"))
        self.pushButton_3.setText(_translate("MainWindow", "摄像头识别"))
        self.pushButton_4.setText(_translate("MainWindow", "退出"))
        self.menu.setTitle(_translate("MainWindow", "目标检测"))


from resources import tu_rc
